package com.example.reagent_management.ui.home.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.reagent_management.R;
import com.example.reagent_management.ui.home.pojo.OperateCounts;
import com.example.reagent_management.ui.home.pojo.PositionCounts;

import androidx.annotation.NonNull;

public class HomeOperateAdapter extends BaseQuickAdapter<OperateCounts, BaseViewHolder> {

    public HomeOperateAdapter() {
        super(R.layout.item_operate);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, OperateCounts positionCounts) {
        baseViewHolder.setText(R.id.content,positionCounts.getContent());
        Glide.with(getContext())
                .load(positionCounts.getImage())
                .transition(DrawableTransitionOptions.withCrossFade(500))
                .into((ImageView) baseViewHolder.getView(R.id.image));

    }
}
